package ooday02;
//重写的演示
public class OverrideDemo {
    public static void main(String[] args){
        //重写方法被调用时，看对象的类型执行方法
        Student zg = new Student("张光",25,"廊坊","jsd2403","001");
        zg.sayHi();//调用Student之后重写的
        Teacher ll = new Teacher("李宁",23,"佳木斯",6000.0);
        ll.sayHi();//调用Teacher之后重写的
        Doctor zl = new Doctor("赵亮",45,"山东","主治医师");
        zl.sayHi();//调用Doctor之后重写的
    }
}
